﻿using NetBrick.Client;
using UniBrickCommon.Packets;
using Utils;

namespace Handler
{
    public class UpdateEventHandler : PacketHandler
    {
        public UpdateEventHandler(Client client)
            : base(client)
        {
        }

        public override void Process(object packetData)
        {
            var updatePacket = (UpdatePacket.Event)packetData;
            UniBrickClient.Instance.UpdatePlayer(updatePacket.Username, ConversionUtils.VectorFromString(updatePacket.Position), ConversionUtils.QuaternionFromString(updatePacket.Rotation));
        }
    }
}